package 公司真题.声网;

import java.util.*;

public class _查找字符 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String target = sc.nextLine();
        // 利用set去重，利用map来存储上一次出现的位置
        Set<Character> set = new HashSet<>();
        Map<Character, Integer> map = new HashMap<>();
        char[] arr = target.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            if (set.add(arr[i])) {
                map.put(arr[i], i);
            } else {
                map.put(arr[i], -1);
            }
        }
        Character res = null;
        int index = Integer.MAX_VALUE;
        for (Character c : map.keySet()) {
            Integer temp = map.get(c);
            if (temp != -1) {
                if (index > temp) {
                    res = c;
                }
            }
        }
        System.out.println(res);

    }


}
